/******************************************************************************
* Copyright (C) 2010-2011 Computer Graphics Systems Group at the 
* Hasso-Plattner-Institute (HPI), Potsdam, Germany.
*
* Lecture : Geovisualisation Summer Term 2011
* Exercise: Processing Rendering OpenStreetMap Data 
*
* Author: sebastian.pasewaldt@hpi.uni-potsdam.de
*
******************************************************************************/

#ifndef __COORDTRANSFORMER_H__
#define __COORDTRANSFORMER_H__

//[-------------------------------------------------------]
//[ Includes                                              ]
//[-------------------------------------------------------]
#include <proj_api.h>

/**
*  @brief
*    OSG viewer for Qt
*/
class CoordTransformer
{

    //[-------------------------------------------------------]
    //[ Public functions                                      ]
    //[-------------------------------------------------------]
    public:
		/**
		*  @brief
		*    Constructor
		*/
        CoordTransformer();
		
		~CoordTransformer(){};
 
		/**
		*  @brief
		*  Transforms coordinates from lat long to an UTM
		*
		*  @param inLat
		*  latitude 
		*
		*  @param inLong
		*  longitude
		*
		*  @param outX
		*  converted latitude
		*
		*  @param outY
		*  converted longitude
		*/
		void transformCoordsFromLatLong(double inLat, double inLong, double& outX, double& outY);
		
		/**
		*  @brief
		*  Transforms coordinates from UTM to lat long (inverted calculation of transformCoordsFromLatLong)
		*
		*  @param inX
		*  UTM x-coord 
		*
		*  @param inY
		*  UTM y-coord
		*
		*  @param outLat
		*  inX converted to latitude
		*
		*  @param outLong
		*  inY converted to longitude
		*/
		void transformCoordsToLatLong(double inX, double inY,  double& outLat, double& outLong);

		//[-------------------------------------------------------]
		//[ Private data
		//[-------------------------------------------------------]
		private:
			projPJ m_pj_utm, m_pj_latlong;
};


#endif // __COORDTRANSFORMER_H__